package com.triadsystems.cashweb.controle.mbean.impl;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;

import lombok.Getter;
import lombok.Setter;

import org.springframework.context.annotation.Scope;

import com.icon.infra.controle.utils.GenericoCRUDBean;
import com.triadsystems.cashweb.modelo.negocio.servicos.IFilialServico;
import com.triadsystems.cashweb.modelo.persistencia.entidades.Empresa;
import com.triadsystems.cashweb.modelo.persistencia.entidades.Filial;

@Named
@Scope("session")
public class FilialBean extends GenericoCRUDBean<Filial, Filial> {

	@Inject
	private IFilialServico filialServico;

	@Getter
	@Setter
	private Empresa empresaCorrente;

	@PostConstruct
	@Override
	protected void inicializarAtributosManagedBean() throws Exception {
		empresaCorrente = new Empresa();
		setObjetoPrincipal(new Filial());
		setObjetoPrincipalServico(filialServico);
	}

}
